package cc.messcat.dao.log;

import java.util.Map;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import cc.messcat.common.dao.BaseDaoImpl;
import cc.messcat.entity.log.Log;
@Repository
public class LogDaoImpl extends BaseDaoImpl<Log> implements LogDao {

	/**
	 * 日志条件删除
	 * @author Fog
	 */
	@Override
	public void removeLog(String hql, Map condition) {
		Query query = getCurrentSession().createQuery(hql);
		if (null != condition) {
			if(condition.get("ids") != null) {
				query.setParameterList("ids", (Long[])condition.get("ids"));
			} else {
				query.setProperties(condition);
			}
		}
		query.executeUpdate();
	}

}
